package com.ymatou.iapi.freightservice.service;

import org.json.JSONException;
import org.json.JSONObject;

import com.google.gson.Gson;
import com.ymatou.iapi.freightservice.parameter.OrdersDto;
import com.ymttest.business.YmatouAutoTestCall;
import com.ymttest.utils.EnvSetup;

public class CalcOrderFreightCall extends YmatouAutoTestCall {
	private static String opurl="/CalcOrderFreight";
	
	public CalcOrderFreightCall(){
		super(EnvSetup.getSystemUrl("freightservice"), opurl, "POST", "JSON");
	}
	
	
	@Override
	public void addDefHeader(){
		client.addHeader("Content-Type", "application/json");
	}
	
	 public JSONObject calcOrderFreight(OrdersDto orders){
		
		
		try {
			return callAndGetReturnData(new JSONObject(new Gson().toJson(orders)));
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return null;
	 }
	

	
	public static void main(String[] args) {
		new CalcOrderFreightCall().calcOrderFreight(new OrdersDto());
	}
}
 